import Vue from 'vue'
import Vuex from 'vuex'
import { getUserInfo } from '../utils/SupervisorApi'
Vue.use(Vuex)

export  default  new  Vuex.Store({
    state: {
        userInfo: {}
    },
    mutations: {
        async getUserInfo(state) {
            const { data: res } = await getUserInfo();
            if (res.meta.status !== 200) {
                return app.$message.error("获取用户信息失败");
            }
            console.log(res);
            state.userInfo = res.data;
        }
    },
    actions: {}
})